<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>选择影片场次</title>
    <link rel="stylesheet" href="./css/film_sessions1.css">
    <link rel="stylesheet" href="./css/film_sessions2.css">
    <script src="./js/jquery.min.js"></script>
    <script src="js/logout.js"></script>
    <script src="js/urlTools.js"></script>
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/selectFile.css">

</head>

<body>
<header>
    <nav>
        <div id="loginControl">
            <!--            <ul>-->
            <!--                            <li><a href="index.html">首页</a></li>-->
            <!--            <li><a href="my_order.html">我的订单</a></li>-->
            <!--            <li id="loginState"><a href="login.html">注册/登录</a></li>-->
            <!--            <li id="logoutState"><a href="javascript: logout()">退出登录</a></li>-->
            <!--            <li><a href="#">联系我们</a></li>-->
            <!--            <div class="slider"></div>-->
            <!--            </ul>-->
        </div>
    </nav>
</header>
<script src="js/detectLoginStatusTool.js"></script>

<div class="banner cinema-banner">
    <div class="wrapper clearfix">
        <div class="cinema-left">
            <div class="avatar-shadow">
                <img class="avatar" src="./img/万达影城.png" alt="万达影城（南阳中泰IMAX店）">
            </div>
        </div>

        <div class="cinema-main clearfix">
            <div class="cinema-brief-container">
                <h1 class="name text-ellipsis">万达影城（南阳中泰IMAX店）</h1>
                <div class="address text-ellipsis">卧龙区独山大道与张衡路交汇处中泰国际购物广场六层</div>
                <div class="telphone">电话：0377-60877118</div>

                <div class="features-group">
                    <div class="group-title">影院服务</div>

                    <div class="feature">
                        <span class="tag ">改签</span>
                        <p class="desc text-ellipsis" title="未取票用户放映前60分钟可改签">
                            未取票用户放映前60分钟可改签</p>
                    </div>
                    <div class="feature">
                        <span class="tag ">3D眼镜收费</span>
                        <p class="desc text-ellipsis"
                           title="本影城提供免费眼镜，为了您的自身健康安全，减少公共物品接触，建议您自备或购买一次性3D眼镜">
                            本影城提供免费眼镜，为了您的自身健康安全，减少公共物品接触，建议您自备或购买一次性3D眼镜</p>
                    </div>
                    <div class="feature">
                        <span class="tag ">儿童优惠</span>
                        <p class="desc text-ellipsis"
                           title="1.3米以下儿童看普通2/3D电影免票，1个大人可免费带1个1.3米以下儿童。">
                            1.3米以下儿童看普通2/3D电影免票，1个大人可免费带1个1.3米以下儿童。</p>
                    </div>
                    <div class="feature">
                        <span class="tag ">可停车</span>
                        <p class="desc text-ellipsis" title="依据广场停车收费标准收费">依据广场停车收费标准收费</p>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>
<div class="container" id="app">
    <div class="crumbs-nav-container">
        <span>万达影城（南阳中泰IMAX店）</span>
    </div>


    <div class="show-list active" data-index="0">
        <div class="movie-info">
            <div>
                <h2 class="movie-name">速度与激情10</h2>


            </div>

            <div class="movie-desc">
                <div>
                    <span class="key">时长 :</span>
                    <span class="value">141分钟</span>
                </div>
                <div>
                    <span class="key">类型 :</span>
                    <span class="value">
                            动作
                        </span>
                </div>
                <div>
                    <span class="key">主演 :</span>
                    <span class="value"> 范·迪塞尔</span>
                </div>
            </div>
        </div>

        <div class="show-date">
            <span>观影时间 :</span>
            <span class="date-item active" data-index="0">今天 5月20</span>
        </div>

        <div class="plist-container active">

            <table class="plist">
                <thead>
                <tr>
                    <th>放映时间</th>
                    <th>语言版本</th>
                    <th>放映厅</th>
                    <th>售价（元）</th>
                    <th>选座购票</th>
                </tr>
                </thead>

                <tbody>
                <tr class="">
                    <td>
                        <span class="begin-time">21:55</span>
                        <br>
                        <span class="end-time">00:16散场</span>
                    </td>
                    <td>
                        <span class="lang">英语IMAX3D</span>
                    </td>
                    <td>
                        <span class="hall">2号-IMAX巨幕厅</span>
                    </td>
                    <td>
                        <span class="sell-price"><span class="stonefont">30.0</span></span>
                    </td>
                    <td>
                        <button class="buy-btn normal" data-tip="" data-act="show-click" data-bid="b_gvh3l8gg"
                                data-val="{movie_id: 343035, cinema_id:23778}" onclick="selectSeat(1)">选座购票
                        </button>
                    </td>
                </tr>
                <tr class="even">
                    <td>
                        <span class="begin-time">22:35</span>
                        <br>
                        <span class="end-time">00:56散场</span>
                    </td>
                    <td>
                        <span class="lang">英语3D</span>
                    </td>
                    <td>
                        <span class="hall">3号厅</span>
                    </td>
                    <td>
                        <span class="sell-price"><span class="stonefont">30.0</span></span>
                    </td>
                    <td>
                        <button class="buy-btn normal" data-tip="" data-act="show-click" data-bid="b_gvh3l8gg"
                                data-val="{movie_id: 343035, cinema_id:23778}" onclick="selectSeat(2)">选座购票
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>


<script>
    let date = new Date();
    document.getElementsByClassName("date-item active")[0].innerHTML = "明天 " + (date.getMonth() + 1) + "月" +(1+date.getDate());
    document.getElementsByClassName("movie-name")[0].innerHTML = '-';
    document.getElementsByClassName("value")[0].innerHTML = '-';
    document.getElementsByClassName("value")[1].innerHTML = '-';
    document.getElementsByClassName("value")[2].innerHTML = '-';
    document.getElementsByClassName("begin-time")[0].innerHTML = '-';
    document.getElementsByClassName("end-time")[0].innerHTML = '-';
    document.getElementsByClassName("begin-time")[1].innerHTML = '-';
    document.getElementsByClassName("end-time")[1].innerHTML = '-';
    document.getElementsByClassName("lang")[0].innerHTML = '-';
    document.getElementsByClassName("lang")[1].innerHTML = '-';
    document.getElementsByClassName("hall")[0].innerHTML = '-';
    document.getElementsByClassName("hall")[1].innerHTML = '-';
    console.log(getQueryVariable("movieId"));


    jQuery.ajax({
        type: 'post',
        url: '/film_sessions',
        data: {
            movieId: getQueryVariable("movieId")
        },
        success: function (body) {
            document.getElementsByClassName("movie-name")[0].innerHTML = body[0].name;
            document.getElementsByClassName("value")[0].innerHTML = body[0].duration;
            document.getElementsByClassName("value")[1].innerHTML = body[0].types;
            document.getElementsByClassName("value")[2].innerHTML = body[0].role;
            document.getElementsByClassName("begin-time")[0].innerHTML = body[0].begintime;
            document.getElementsByClassName("end-time")[0].innerHTML = body[0].endtime;
            document.getElementsByClassName("begin-time")[1].innerHTML = body[1].begintime;
            document.getElementsByClassName("end-time")[1].innerHTML = body[1].endtime;
            document.getElementsByClassName("lang")[0].innerHTML = body[0].language;
            document.getElementsByClassName("lang")[1].innerHTML = body[1].language;
            document.getElementsByClassName("hall")[0].innerHTML = body[0].hall;
            document.getElementsByClassName("hall")[1].innerHTML = body[1].hall;
        }
    });


    function selectSeat(id) {
        let movieId = getQueryVariable("movieId");
        location.href = "ticketing.html?movieId=" + movieId + "&hall=IMAX" + id + "号厅";
    }
</script>

</body>

</html>